package wfw.cn.ktc_common.service;

import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

import java.util.List;
import java.util.Optional;

public interface BaseService<T,ID> {

    
   default List<T> findAll(){return null;};


    default List<T> findAll(Sort sort){return null;};


    default List<T> findAllById(Iterable<ID> iterable){return null;};


    default <S extends T> List<S> saveAll(Iterable<S> iterable){return null;};


    default void flush(){};


    default <S extends T> S saveAndFlush(S s){return null;};


    default void deleteInBatch(Iterable<T> iterable){};


    default void deleteAllInBatch(){};


    default T getOne(ID s){return null;};


    default <S extends T> List<S> findAll(Example<S> example){return null;};


    default <S extends T> List<S> findAll(Example<S> example, Sort sort){return null;};


    default Page<T> findAll(Pageable pageable){return null;};


    default <S extends T> S save(S s){return null;};


    default T findById(ID s){return null;};


    default boolean existsById(Object s){return false;};


    default long count(){return 0;};


    default void deleteById(Object s){};


    default void delete(T t){};


    default void deleteAll(Iterable<? extends T> iterable){};


    default void deleteAll(){};


    default <S extends T> Optional<S> findOne(Example<S> example){return null;};


    default  <S extends T> Page<S> findAll(Example<S> example, Pageable pageable){return null;};


    default <S extends T> long count(Example<S> example){return 0;};


    default <S extends T> boolean exists(Example<S> example){return false;};
}
